UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vjvtqvnpaliS91i8PuLyXarA2Cxo6QXeEcQGflb6C2U=' 
WHERE 
  key_id = 'eda7803c8d0f8e9a1ce8d9e7b3edb9e744f6cd75d614d0424bb08fc40c8cba81' 
  AND (
    token = 'vjvtqvnpaliS91i8PuLyXarA2Cxo6QXeEcQGflb6C2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051